<?php

error_reporting(E_ERROR);
ini_set("arg_seperator.output","&");
ini_set("magic_quotes_runtime",0);
define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc());
define('ROOT_PATH',dirname(__FILE__) .'/');
define('RELATIVE_ROOT_PATH','./');
define('IN_JISHIGOU_IMJIQIREN',true);
class initialize
{
function init()
{
$config=array();
require ROOT_PATH .'setting/settings.php';
@header('Content-Type: text/html; charset='.$config['charset']);
if($config['install_lock_time'] <1)
{
if (!is_file(ROOT_PATH .'install/install.lock') &&is_file(ROOT_PATH .'install.php'))
{
die("<a href='./install.php'>请点此进行系统的安装</a>");
}
}
if ($config['upgrade_lock_time'] >0)
{
if(($config['upgrade_lock_time'] +180 >time()) ||(is_file(ROOT_PATH .'cache/upgrade.lock') &&@filemtime(ROOT_PATH .'cache/upgrade.lock')+600>time()))
{
die('系统升级中，请稍候……');
}
}
if ($config['site_closed'])
{
if ('login'!=$_GET['mod'] &&$site_enable_msg=file_get_contents('./cache/site_enable.php'))
{
die($site_enable_msg);
}
}
if(!$config['imjiqiren_enable'])
{
exit('IMJIQIREN功能没有启用');
}
else
{
require ROOT_PATH .'setting/imjiqiren.php';
}
require ROOT_PATH .'setting/constants.php';
if ($config['rewrite_enable'])
{
include(ROOT_PATH .'include/rewrite.php');
}
require_once ROOT_PATH .'include/function/global.func.php';
require_once ROOT_PATH .'modules/imjiqiren/master.mod.php';
require_once ROOT_PATH .'modules/imjiqiren/'.$this->SetEvent() .'.mod.php';
if($_GET)
{
$_GET		= jaddslashes($_GET,1,TRUE);
}
if($_POST)
{
$_POST		= jaddslashes($_POST,1,TRUE);
}
$moduleobject = new ModuleObject($config);
}
function SetEvent()
{
$modss = array ( 'imjiqiren'=>1,);
$mod = (isset($_POST['mod']) ?$_POST['mod'] : $_GET['mod']);
if(!$mod)
{
$mod = "imjiqiren";
}
if(!isset($modss[$mod]))
{
exit('mod is invalid');
}
$_POST['mod'] = $_GET['mod'] = $mod;
return $mod;
}
}
$init=new initialize;
$init->init();
?>